
/*
Author: jfwang213
*/


/*
this program is based on the paper of Esko Ukkonen
on-line construction of suffix trees
*/


#ifndef _SUFFIX_TREE_H_
#define _SUFFIX_TREE_H_

#define CHAR_SET_NUM 26

#include "stdio.h"



typedef struct suffix_tree_node
{
	int beg;
	int end;
	struct suffix_tree_node *childs[CHAR_SET_NUM];
	struct suffix_tree_node *suffix_link;
}suffix_tree_node;

typedef struct suffix_tree 
{
	char* str_content;
	suffix_tree_node *root;
}suffix_tree;

suffix_tree* init_suffix_tree();
void build_suffix_tree(suffix_tree* tree,char *content);
void print_suffix_tree(FILE* output_file,suffix_tree *root);

#endif